package com.base.self.service.impl;

import com.base.self.service.ISelfGoodsService;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

/**
 * <p>
 * 商品信息 服务实现类
 * </p>
 *
 * @author Kong
 * @since 2020-11-23
 */
@Service
public class SelfGoodsServiceImpl implements ISelfGoodsService {

    @Override
    public BigDecimal getGoodsPaymentPrice(BigDecimal costPrice) {
        // 公式 （n*3^14-原价*3^13)/n*3^14 = 0.2753
        BigDecimal paymentPrice = costPrice.divide(new BigDecimal(2.1739), 2, BigDecimal.ROUND_HALF_UP);
        return paymentPrice;
    }
}
